package com.youhp.spire.xls.demo.Charts.ManipulateChart;

import com.spire.xls.*;

public class AddDataTable {

    public static void main(String[] args) {

        //Create a Workbook
        Workbook workbook = new Workbook();
        workbook.loadFromFile("data/AddDataTable.xlsx");

        //Get the first sheet
        Worksheet sheet = workbook.getWorksheets().get(0);

        //Get the first chart
        Chart chart = sheet.getCharts().get(0);

        //Add data table
        chart.hasDataTable(true);

        //Save the result file
        workbook.saveToFile("output/AddDataTable.xlsx", FileFormat.Version2010);
    }
}
